# Example 5 page 53 from "Basic Mechanics of Laminated Composite Plates" # A.T. Nettles # NASA Reference Publication 1351 # same example as no 5, this time using the database


In [1]:
import pyPLY
from pyPLYMaterialDB import AS4_3501_6 as AS4

layer1 = pyPLY.Lamina()
layer2 = pyPLY.Lamina()
layer3 = pyPLY.Lamina()
layer4 = pyPLY.Lamina()

# the second parameter can be a number or an instance.
layer1.define("Layer_1", 1, 0)
layer2.define("Layer_2", AS4, 45)
layer3.define("Layer_3", 1, 45)
layer4.define("Layer_4", 1, 0)

layer1.update()
layer2.update()
layer3.update()
layer4.update()

laminate1 = pyPLY.Laminate()
laminate1.add_Lamina(layer1)
laminate1.add_Lamina(layer2)
laminate1.add_Lamina(layer3)
laminate1.add_Lamina(layer4)

laminate1.update()

load1 = pyPLY.Loading()
load1.define_Load(500,0,0,0,0,0,-155.6,0.007)
load1.apply_To(laminate1)

from numpy import set_printoptions
set_printoptions(suppress=True)

print "self.thermal_load"
print load1.thermal_load
print "---------------------------"
print "self.moisture_load"
print load1.moisture_load
print "---------------------------"
print "load1"
print load1.load
print "---------------------------"
print "load1.epsilon_K"
print load1.epsilon_K
print "---------------------------"
print "     layerNo", "epsx", " epsy", " gammaxy"
for i in range (0, 4):
    strain = load1.list_ply_strains_xy[i*3 + 0]
    print "bottom  ", i+1, '{0:+.4}'.format(strain[0,0]), '{0:+.4}'.format(strain[1,0]), '{0:+.4}'.format(strain[2,0])
    strain = load1.list_ply_strains_xy[i*3 + 1]
    print "centroid", i+1, '{0:+.4}'.format(strain[0,0]), '{0:+.4}'.format(strain[1,0]), '{0:+.4}'.format(strain[2,0])
    strain = load1.list_ply_strains_xy[i*3 + 2]
    print "top     ", i+1, '{0:+.4}'.format(strain[0,0]), '{0:+.4}'.format(strain[1,0]), '{0:+.4}'.format(strain[2,0])
    print

print
print "------------------------------------------"
print "     layerNo", "sigmax", "  sigmay", "  sigmaxy"
for i in range (0, 4):
    stress = load1.list_ply_stresses_xy[i*3 + 0]
    print "bottom  ", i+1, '{0:+.4}'.format(stress[0,0]), '{0:+.4}'.format(stress[1,0]), '{0:+.4}'.format(stress[2,0])
    stress = load1.list_ply_stresses_xy[i*3 + 1]
    print "centroid", i+1, '{0:+.4}'.format(stress[0,0]), '{0:+.4}'.format(stress[1,0]), '{0:+.4}'.format(stress[2,0])
    stress = load1.list_ply_stresses_xy[i*3 + 2]
    print "top     ", i+1, '{0:+.4}'.format(stress[0,0]), '{0:+.4}'.format(stress[1,0]), '{0:+.4}'.format(stress[2,0])
    print

print
print "------------------------------------------"
print "     layerNo", "eps11", "    eps22", "  gamma12"
for i in range (0, 4):
    strain = load1.list_ply_strains_12[i*3 + 0]
    print "bottom  ", i+1, '{0:+.4}'.format(strain[0,0]), '{0:+.4}'.format(strain[1,0]), '{0:+.4}'.format(strain[2,0])
    strain = load1.list_ply_strains_12[i*3 + 1]
    print "centroid", i+1, '{0:+.4}'.format(strain[0,0]), '{0:+.4}'.format(strain[1,0]), '{0:+.4}'.format(strain[2,0])
    strain = load1.list_ply_strains_12[i*3 + 2]
    print "top     ", i+1, '{0:+.4}'.format(strain[0,0]), '{0:+.4}'.format(strain[1,0]), '{0:+.4}'.format(strain[2,0])
    print

print
print "------------------------------------------"
print "     layerNo", "sigma11", "    sigma22", "  tau12"
for i in range (0, 4):
    stress = load1.list_ply_stresses_12[i*3 + 0]
    print "bottom  ", i+1, '{0:+.4}'.format(stress[0,0]), '{0:+.4e}'.format(stress[1,0]), '{0:+.4}'.format(stress[2,0])
    stress = load1.list_ply_stresses_12[i*3 + 1]
    print "centroid", i+1, '{0:+.4}'.format(stress[0,0]), '{0:+.4e}'.format(stress[1,0]), '{0:+.4}'.format(stress[2,0])
    stress = load1.list_ply_stresses_12[i*3 + 2]
    print "top     ", i+1, '{0:+.4}'.format(stress[0,0]), '{0:+.4e}'.format(stress[1,0]), '{0:+.4}'.format(stress[2,0])
    print


self.thermal_load
[[-32.92889373]
 [-59.814231  ]
 [ 13.44266864]
 [  0.        ]
 [  0.        ]
 [ -0.        ]]
---------------------------
self.moisture_load
[[ 51.73058536]
 [ 60.35943773]
 [ -4.31442619]
 [ -0.        ]
 [ -0.        ]
 [  0.        ]]
---------------------------
load1
[[ 518.80169163]
 [   0.54520673]
 [   9.12824245]
 [  -0.        ]
 [   0.        ]
 [  -0.        ]]
---------------------------
load1.epsilon_K
[[ 0.00226746]
 [-0.00086961]
 [-0.00091887]
 [-0.        ]
 [-0.        ]
 [ 0.        ]]
---------------------------
     layerNo epsx  epsy  gammaxy
bottom   1 +0.002267 -0.0008696 -0.0009189
centroid 1 +0.002267 -0.0008696 -0.0009189
top      1 +0.002267 -0.0008696 -0.0009189

bottom   2 +0.002267 -0.0008696 -0.0009189
centroid 2 +0.002267 -0.0008696 -0.0009189
top      2 +0.002267 -0.0008696 -0.0009189

bottom   3 +0.002267 -0.0008696 -0.0009189
centroid 3 +0.002267 -0.0008696 -0.0009189
top      3 +0.002267 -0.0008696 -0.0009189

bottom   4 +0.002267 -0.0008696 -0.0009189
centroid 4 +0.002267 -0.0008696 -0.0009189
top      4 +0.002267 -0.0008696 -0.0009189


------------------------------------------
     layerNo sigmax   sigmay   sigmaxy
bottom   1 +4.39e+04 +181.3 -919.8
centroid 1 +4.39e+04 +181.3 -919.8
top      1 +4.39e+04 +181.3 -919.8

bottom   2 +6099.0 -181.3 +919.8
centroid 2 +6099.0 -181.3 +919.8
top      2 +6099.0 -181.3 +919.8

bottom   3 +6099.0 -181.3 +919.8
centroid 3 +6099.0 -181.3 +919.8
top      3 +6099.0 -181.3 +919.8

bottom   4 +4.39e+04 +181.3 -919.8
centroid 4 +4.39e+04 +181.3 -919.8
top      4 +4.39e+04 +181.3 -919.8


------------------------------------------
     layerNo eps11     eps22   gamma12
bottom   1 +0.002267 -0.0008696 -0.0009189
centroid 1 +0.002267 -0.0008696 -0.0009189
top      1 +0.002267 -0.0008696 -0.0009189

bottom   2 +0.0002395 +0.001158 -0.003137
centroid 2 +0.0002395 +0.001158 -0.003137
top      2 +0.0002395 +0.001158 -0.003137

bottom   3 +0.0002395 +0.001158 -0.003137
centroid 3 +0.0002395 +0.001158 -0.003137
top      3 +0.0002395 +0.001158 -0.003137

bottom   4 +0.002267 -0.0008696 -0.0009189
centroid 4 +0.002267 -0.0008696 -0.0009189
top      4 +0.002267 -0.0008696 -0.0009189


------------------------------------------
     layerNo sigma11     sigma22   tau12
bottom   1 +4.39e+04 +1.8133e+02 -919.8
centroid 1 +4.39e+04 +1.8133e+02 -919.8
top      1 +4.39e+04 +1.8133e+02 -919.8

bottom   2 +3879.0 +2.0391e+03 -3140.0
centroid 2 +3879.0 +2.0391e+03 -3140.0
top      2 +3879.0 +2.0391e+03 -3140.0

bottom   3 +3879.0 +2.0391e+03 -3140.0
centroid 3 +3879.0 +2.0391e+03 -3140.0
top      3 +3879.0 +2.0391e+03 -3140.0

bottom   4 +4.39e+04 +1.8133e+02 -919.8
centroid 4 +4.39e+04 +1.8133e+02 -919.8
top      4 +4.39e+04 +1.8133e+02 -919.8


In [ ]: